package com.xiaoxi.common.constant.enumeration.statuscode.user;

import com.xiaoxi.common.constant.enumeration.statuscode.ParentEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiaoxi
 * @version 1.0
 * @date 2022/6/7 14:53
 */
public enum RoleUserEnums implements ParentEnum {

    DATABASE_EXCEPTION("A060", "数据库发生异常"),
    PLEASE_PASS_THE_ROLE_NAME("A061", "请传递角色名称"),
    PLEASE_PASS_THE_ICON("A062", "请传递图标"),
    INCORRECT_ROLE_ID("A063", "未找到该角色"),
    ROLE_REGISTERED("A064","角色名称已使用");

    private final String code;
    private final String message;

    RoleUserEnums(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    @Override
    public Map<String, String> format() {
        Map<String, String> enumData = new HashMap<>();
        enumData.put("code", this.code);
        enumData.put("message", this.message);
        return enumData;
    }
}
